package com.neouton.crm.supplier.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.neouton.common.util.PageUtil;
import com.neouton.crm.customer.entity.CustomerVO;
import com.neouton.crm.supplier.entity.SupplierVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public interface SupplierService {

    /**
     * 多条件分页查询客户信息列表
     *
     * @param page     分页信息
     * @param supplier 其余查询条件
     * @return 分页查询结果
     * @Timestamp: 2022-11-18
     * @Author: WuJie
     */
    PageUtil<SupplierVO> querySupplierByPage(IPage page, SupplierVO supplier, String orderBy);


    /**
     * 新增或更新客户信息
     *
     * @param supplier 需更新实体
     * @return 成功失败
     * @Timestamp: 2022-11-17
     * @Author: WuJie
     */
    Boolean saveOrUpdateSupplier(SupplierVO supplier,String token);

    /**
     * 删除客户信息
     *
     * @param supplierId 需删除的ID
     * @return 成功失败
     * @Timestamp: 2022-11-22
     * @Author: WuJie
     */
    Boolean deleteSupplierById(Integer supplierId);
    Boolean enableSupplierById(Integer supplierId);

    /**
     * 根据部分条件查询客户信息是否存在
     * @param sp
     * @return
     */
    SupplierVO querySupplier(SupplierVO sp);


    /**
     * 查询并更改是否为客户，每次刷新更新
     * @return true成功，false失败
     */
    Boolean selectIsCustomer();

    Boolean approveSupplier(SupplierVO supplier, String token,Boolean auto);

    Boolean rejectionSupplier(SupplierVO supplier, String token);

    List<SupplierVO> selectAllEnterprise();

    List<SupplierVO> selectAllSupplier();

    void exportSupplierInfo(HttpServletResponse response, SupplierVO entit) throws Exception;

    Map<String,Object> queryTodoSupplierByApprovalId(Integer approvalId);

    Map<String,Object> queryTHistorySupplierByApprovalId(Integer approvalId);

    Boolean forbiddenCustomerByApplyId(Integer approvalId);

    PageUtil<SupplierVO> getSupplierToDoList(IPage<SupplierVO> page, SupplierVO supplier, String orderBy, String token);

    PageUtil<SupplierVO> getSupplierDoneList(IPage<SupplierVO> page, SupplierVO supplier, String orderBy, String token);

    PageUtil<SupplierVO> getSupplierRecordsList(IPage<SupplierVO> page, SupplierVO supplier, String orderBy, String token);

    SupplierVO querySupplierCorrelationBySupplierID(int supplierId, String token);

    SupplierVO getSupplierDocumentaryViewInfo(Integer supplierId, String token);
}
